package org.itstack.demo.design;

/**
 * @Author: gs
 * @Date: 2024/9/4 21:19
 * @Version: v1.0.0
 * @Description: TODO
 **/

/*
* 线程安全的懒汉模式
* */
public class Singleton_02 {

    private static Singleton_02 instance;

    private  Singleton_02(){

    }

    public static synchronized Singleton_02 getInstance(){

        if (null != instance){
            return instance;
        }
        return new Singleton_02();
    }

}
